This is prep for introducing a fd-relative `ostree_repo_new_at()`.
Previously, `ostree_repo_is_system()` compared `GFile` paths, but
there's a much simpler check we can do first - if this repository
was created via `OstreeSysroot`, it must be a system repo.
Closes: #886
Approved by: jlebon
gboolean inited;
gboolean writable;
+ gboolean is_system; /* Was this repo created via ostree_sysroot_get_repo() ? */
GError *writable_error;
gboolean in_transaction;
gboolean disable_fsync;
g_return_val_if_fail (OSTREE_IS_REPO (repo), FALSE);
+ /* If we were created via ostree_sysroot_get_repo(), we know the answer is yes
+ * without having to compare file paths.
+ */
+ if (repo->is_system)
+ return TRUE;
+
default_repo_path = get_default_repo_path (repo->sysroot_dir);
return g_file_equal (repo->repodir, default_repo_path);
#include <sys/wait.h>
#include "ostree-core-private.h"
+#include "ostree-repo-private.h"
#include "ostree-sepolicy-private.h"
#include "ostree-sysroot-private.h"
#include "ostree-deployment-private.h"
repo_path = g_file_resolve_relative_path (self->path, "ostree/repo");
self->repo = ostree_repo_new_for_sysroot_path (repo_path, self->path);
+ self->repo->is_system = TRUE;
G_OBJECT_CLASS (ostree_sysroot_parent_class)->constructed (object);
}